home *** CD-ROM | disk | FTP | other *** search
- import java.util.Random;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.midlet.MIDlet;
-
- public class HolyMoley extends MIDlet implements CommandListener, Runnable {
- // $FF: renamed from: dp javax.microedition.lcdui.Display
- private Display field_0 = Display.getDisplay(this);
- private static Random rand = new Random();
- // $FF: renamed from: ex javax.microedition.lcdui.Command
- private Command field_1 = new Command("Exit", 1, 3);
- private Command start = new Command("Start", 1, 2);
- private Command Pause = new Command("Pause", 1, 2);
- private Command Resume = new Command("Resume", 1, 3);
- private boolean play;
- // $FF: renamed from: hc HC
- private HC field_2 = new HC();
- // $FF: renamed from: mx MsgBox
- private MsgBox field_3 = new MsgBox();
- private Title ttl = new Title();
- // $FF: renamed from: sn int
- private int field_4;
- private int speed;
-
- public HolyMoley() {
- this.field_2.addCommand(this.Resume);
- this.field_2.addCommand(this.Pause);
- this.field_2.setCommandListener(this);
- this.field_3.addCommand(this.field_1);
- this.ttl.addCommand(this.field_1);
- this.ttl.addCommand(this.start);
- this.ttl.setCommandListener(this);
- Title.mT = 2;
- this.field_0.setCurrent(this.ttl);
- this.ttl.repaint();
- }
-
- public void commandAction(Command var1, Displayable var2) {
- if (var1 == this.field_1) {
- this.destroyApp(false);
- ((MIDlet)this).notifyDestroyed();
- } else if (var1 == this.start) {
- this.firstStart();
- } else if (var1 == this.Pause) {
- this.pauseApp();
- } else if (var1 == this.Resume) {
- this.startApp();
- this.restartThread();
- }
-
- }
-
- public void destroyApp(boolean var1) {
- }
-
- public void firstStart() {
- this.field_2.init();
- this.field_4 = 0;
- this.speed = 60;
- HC.playSt = true;
- this.play = true;
- Thread var1 = new Thread(this);
- var1.start();
- }
-
- public void pauseApp() {
- this.play = false;
- }
-
- public void restartThread() {
- Thread var1 = new Thread(this);
- var1.start();
- }
-
- public void run() {
- if (this.play) {
- do {
- this.threadP(this.speed);
- if (this.field_4 == 0) {
- this.startSet();
- }
-
- this.field_2.repaint();
- if (HC.gameover) {
- this.threadP(800);
- Title.mT = 3;
- int var1 = this.field_2.returnS();
- Title.mscore = var1;
- this.field_0.setCurrent(this.ttl);
- this.ttl.repaint();
- this.play = false;
- HC.playSt = false;
- } else if (!HC.playSt) {
- this.play = false;
- HC.playSt = false;
- this.threadP(800);
- MsgBox.mT = 1;
- MsgBox.life = this.field_2.returnH();
- this.field_0.setCurrent(this.field_3);
- HC.score += 10 * this.field_2.returnH();
- this.threadP(2000);
- if (this.field_4 == 6) {
- Title.mT = 1;
- int var2 = this.field_2.returnS();
- Title.mscore = var2;
- this.field_0.setCurrent(this.ttl);
- this.ttl.setCommandListener(this);
- this.ttl.repaint();
- this.play = false;
- HC.playSt = false;
- } else {
- this.startSet();
- }
- }
- } while(this.play);
-
- }
- }
-
- public void startApp() {
- this.play = true;
- }
-
- public void startSet() {
- ++this.field_4;
- HC.stnum = this.field_4;
- this.speed -= 10;
- if (this.speed < 0) {
- this.speed = 0;
- }
-
- this.field_3.setCommandListener(this);
- MsgBox.stgNum = this.field_4;
- MsgBox.mT = 0;
- this.field_0.setCurrent(this.field_3);
- this.field_3.repaint();
- this.threadP(1500);
- this.play = true;
- HC.playSt = true;
- this.field_0.setCurrent(this.field_2);
- this.field_2.startSet();
- this.field_2.repaint();
- }
-
- public void threadP(int var1) {
- try {
- Thread.sleep((long)var1);
- } catch (InterruptedException var2) {
- }
-
- }
- }
-